package com.wzd.learn.springboot.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wzd.learn.springboot.persistence.entity.RedPkgStatistic;
import com.wzd.learn.springboot.service.RedpkgStatisticService;

@Controller
public class RedpkgStatisticController {
	@Resource
	private RedpkgStatisticService redpkgStatisticService;

	@GetMapping("/get")
	@ResponseBody
	public RedPkgStatistic getStatistic(@RequestParam("id") Long activityId) {
		try {
			redpkgStatisticService.batchRecord();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return redpkgStatisticService.getById(activityId);
	}
}
